<?php

include("lib/Database.class.php");
include("lib/Validate.class.php");

class Article_manage
{
	public $id, $post;
	
	public function __construct($id = null, $post = null)
	{
		$this->id  = $id;
		
		if(isset($post))
		{
			$this->post = $post;
		}
	}
	
	public function header()
    {
		$columns = array("title");
		$where   = array("id" => 2);
		$app     = Database::select_query("IE6", $columns, $where);
			
		include("content/ThinApp/manage/header.inc.php");
    }
	
	public function content($step = null)
	{
		$where   = array("id" => $this->id);
		$app     = Database::select_query("IE6", null, $where);
		
		include("content/ThinApp/manage/content.inc.php");
	}
	
	public function footer()
	{
		include("content/ThinApp/manage/footer.inc.php");
	}
	
	public function create($step)
	{
		switch($step)
		{
			case "1":
				echo $this->header();
				echo $this->content($step);
				echo $this->footer();
			break;
			case "2":
				echo $this->header();
				echo $this->content();
				if(isset($this->post['appname']))
				echo $this->forms($this->post['appname']);
				echo $this->footer();
			break;
			case "3":
				foreach($this->post as $key => $value)
				{
				
				}
			break;
		}
	}
	
	public function edit()
	{
	
	}
	
	public function forms($appname)
	{
		include("content/ThinApp/manage/forms.inc.php");
	}
	
	public function submit($step)
	{
		$where   = array("id" => $this->id);
		$IE6     = Database::select_query("IE6", null, $where);
	}
	
	public function createPage()
	{
		echo $this->header();
		echo $this->content();
		echo $this->footer();
	}
}

?>